home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13953 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  31 lines

  1. Path: FreeNet.Carleton.CA!ah956
  2. From: ah956@FreeNet.Carleton.CA (Susheel Jalali)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Need help using g++ and Templates
  5. Date: 28 Mar 1996 04:42:22 GMT
  6. Organization: National Capital Freenet, Ottawa, Canada
  7. Sender: ah956@freenet.carleton.ca (Susheel Jalali)
  8. Message-ID: <4jd5be$7va@freenet-news.carleton.ca>
  9. NNTP-Posting-Host: freenet.carleton.ca
  10.  
  11. I think
  12. Is it true that you cannot have 
  13. #pragma  implementation "abc.h"
  14.  
  15. in more than one .cc file?
  16.  
  17. If I do then I get multiply defined symbols.
  18.  
  19. But if I instantiate those templates in more than one .cc
  20. file what am I supposed to do with #pragma's in those files?
  21. I get undefined symbols too!
  22.  
  23. I do:  put templates in .h files and use #pragma interface
  24. with those.  Then make sure that each such file gets
  25. 'associated' with exactly one .cc file and use #pragma
  26. implementation with that file.  The association defaults
  27. to the files with the same stem name, so you need to
  28. do explicit #pragma implementation "file.h" for cases
  29. without "file.cc" in, say, you main.cc module.
  30.  
  31.